
<div id="toolbar-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
    <div id="toolbar" class="toolbar">
        <table class="toolbar"><tbody><tr>
        	<td id="toolbar-save" class="button"><a class="toolbar" onClick="javascript: submitbutton('save'); return false;" href="javascript:void(0);"> <span title="Save" class="icon-32-save"> </span> Save </a> </td>
	        <td id="toolbar-cancel" class="button"><a class="toolbar" onClick="javascript: submitbutton('cancel'); return false;" href="javascript:void(0);"> <span title="Cancel" class="icon-32-cancel"> </span> Cancel </a> </td>
        </tr></tbody></table>
    </div>
    <div class="header icon-48-user">chỉnh sửa nội dung banner</div>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
<div class="clr"></div>
<div id="element-box">
  <div class="t">
    <div class="t">
      <div class="t"></div>
    </div>
  </div>
  <div class="m">
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
                if($('#BannerTitle').val() == ''){
                    h3l_show_alert($('#BannerTitle'), 'Vui lòng nhập title');
                    $('#BannerTitle').focus();
                    return;
                }
                if($('#BannerUrl').val() == ''){
                    h3l_show_alert($('#BannerUrl'), 'Vui lòng nhập url (vd http://5giay.vn)');
                    $('#BannerUrl').focus();
                    return;
                }
                var re = /^.*[0-9]+$/i;
                if(!re.test($('#BannerWidth').val())){
                    $('#BannerWidth').focus().val('');
                    h3l_show_alert($('#BannerWidth'), 'Vui lòng nhập Width');
                    return;
                }
                if(!re.test($('#BannerHeight').val())){
                    $('#BannerHeight').focus().val('');
                    h3l_show_alert($('#BannerHeight'), 'Vui lòng nhập Height');
                    return;
                }
                submitform( pressbutton );
	}
</script>
    <?php echo $this->Form->create('Banner', array('type'=>'file', 'style'=> 'clear: both;', 'name'=>'adminForm', 'id'=>'adminForm')); ?>
      <div class="col">
        <fieldset class="adminform">
        <legend>User Details</legend>
        <table cellspacing="1" class="admintable">
          <tbody>
            <tr>
              <td width="150" class="key"><label for="title"> title </label>
              </td>
              <td>
                    <?php echo $this->Form->input('title', array('class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>

            <tr>
              <td width="150" class="key"><label for="published"> Published </label>
              </td>
              <td>
                    <?php echo $this->Form->radio('published', array('1'=> 'Yes', 0=>'No'), array('legend'=>false,'default'=> '1')); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="url"> url </label>
              </td>
              <td>
                    <?php echo $this->Form->input('url', array('class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="width">width</label>
              </td>
              <td>
                    <?php echo $this->Form->input('width', array('class'=>'inputbox', 'size'=> 10, 'label'=> false)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="height">height</label>
              </td>
              <td>
                    <?php echo $this->Form->input('height', array('class'=>'inputbox', 'size'=> 10, 'label'=> false)); ?>
              </td>
            </tr>

            <tr>
              <td width="150" class="key"><label for="banner_type">Banner type</label>
              </td>
              <td>
                    <?php echo $this->Form->select('banner_type',$banner_type_list, array('empty'=> false,'secure'=>true)); ?>
              </td>
            </tr>
            <tr>
              <td width="150" class="key"><label for="open_type">Open type</label>
              </td>
              <td>
                    <?php echo $this->Form->select('open_type', $banner_open_type, array('empty'=> false,'secure'=>true)); ?>
              </td>
            </tr>
            <?php if($check_thumbnail_exist): ?>
            <tr>
              <td width="150" class="key"><label for="preview">Preview </label>
              </td>
              <td>
                    <?php
                        echo $this->Html->image($image_url);
                    ?>
                    <?php echo $this->Form->input('delete_image', array('type'=>'checkbox', 'class'=>'inputbox', 'label'=> false)); ?>
                    Xóa Hình Này
              </td>
              
            </tr>
            <?php
                endif;
            ?>
            <tr>
              <td width="150" class="key"><label for="images">Thumbnail </label>
              </td>
              <td>
                    <?php echo $this->Form->input('images', array('type'=>'file', 'class'=>'inputbox', 'size'=> 40, 'label'=> false)); ?>
              </td>
            </tr>
          </tbody>
        </table>
        </fieldset>
      </div>
      <div class="clr"></div>
      <?php echo $this->Form->input('id', array('type'=>'hidden')); ?>
      <input type="hidden" name="task" value="" />
    </form>
    <div class="clr"></div>
  </div>
  <div class="b">
    <div class="b">
      <div class="b"></div>
    </div>
  </div>
</div>
